<template>
  <!-- 顶部通栏 -->
  <AppTopNav />
  <!-- 头部通栏 -->
  <AppHeader />
  <!-- 吸顶头部 -->
  <AppHeaderSticky />
  <!-- 内容容器 -->
  <div class="app-body">
    <!-- 二级路由 -->
    <RouterView />
  </div>
  <!-- 底部通栏 -->
  <AppFooter />
</template>

<script>
import { defineAsyncComponent } from 'vue'
import { useStore } from 'vuex'
export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: 'Layout',
  components: {
    AppTopNav: defineAsyncComponent(() => import('@/components/app-navber.vue')),
    AppHeader: defineAsyncComponent(() => import('@/components/app-header.vue')),
    AppFooter: defineAsyncComponent(() => import('@/components/app-footer.vue')),
    AppHeaderSticky: defineAsyncComponent(() => import('@/components/app-header-sticky.vue'))
  },
  // 获取一下分类数据
  setup () {
    const store = useStore()
    store.dispatch('category/getList')
  }
}
</script>

<style lang="less" scoped>
.app-body{
  min-height: 600px;
}
</style>
